import React from 'react'
import { NavBar } from 'antd-mobile/2x'
import { useHistory } from 'react-router-dom'
export default function Nav(props) {
    const { goBack } = useHistory();
    return (
        <div>
            <NavBar style={{
                '--border-bottom': '1px #eee solid',
                background: props.backColor || "#4876ff",
                color: props.backColor ? "#333" : "#fff",
            }} onBack={() => goBack()}>{props.children}</NavBar>
        </div>
    )
}
